<img src="/estadisticas/save/13" width="1" height="1">
<div id="titulo_encabezado">
	<div style="padding: 17px"><?php echo __('Buscador de Personas', true) ?></div>
	<div id="efecto-box">&nbsp;</div>
</div>
<div id="contenido_gral">
<?php echo $this->Form->create('Person');?>
    <table cellpadding = "0" cellspacing = "10" width="100%">
      <tr> 
        <td width="50%"><?php echo $this->Form->input('name',array( 'label' => '1er. Nombre')); ?></td>
        <td width="50%"><?php echo $this->Form->input('name2',array( 'label' => '2do. Nombre')); ?></td>
      </tr>
      <tr> 
        <td><?php echo $this->Form->input('lastname',array( 'label' => '1er. Apellido')); ?></td>
        <td><?php echo $this->Form->input('lastname2',array( 'label' => 'Otros Apellidos'));?></td>
      </tr>
      <tr> 
        <td><?php echo $this->Form->input('fecha_nacimiento',array( 'label' => 'Fecha de Nacimiento', 'empty' => '---'
                                    , 'dateFormat' => 'DMY'
                                    , 'minYear' => date('Y') - 80
                                    , 'maxYear' => date('Y') ));?></td>
        <td><?php echo $this->Form->input('sex_id',array( 'label' => 'Sexo', 'empty' => '--- Seleccione uno ---')); ?></td>
      </tr>
      <tr> 
        <td><?php echo $this->Form->input('typodocument_id',array( 'label' => 'Tipo de Documento','empty' => '--- Seleccione uno ---'));?></td>
        <td><?php echo $this->Form->input('nro_documento',array( 'label' => 'Nro. de Documento'));?></td>
      </tr>
      <tr> 
        <td colspan="2"><?php echo $this->Form->end(__('Realizar Búsqueda', true));?></td>
      </tr>
    </table>
<p>&nbsp;</p>
<?php echo $this->element('resultado_pacientes'); ?>
<?php
		if(!empty($busquedarealizada) AND $busquedarealizada == "S"){

			echo $this->Form->create('Person',array( 'url' => 'add'));
				echo $this->Form->input('name',array( 'type' => 'hidden'));
				echo $this->Form->input('name2',array( 'type' => 'hidden'));
				echo $this->Form->input('name3',array( 'type' => 'hidden'));
				echo $this->Form->input('lastname',array( 'type' => 'hidden'));
				echo $this->Form->input('lastname2',array( 'type' => 'hidden'));
				echo $this->Form->input('lastname3',array( 'type' => 'hidden'));
				echo $this->Form->input('gender_id',array( 'type' => 'hidden'));
				echo $this->Form->input('sex_id',array( 'type' => 'hidden'));
				echo $this->Form->input('fecha_nacimiento.day',array( 'type' => 'hidden' ));
				echo $this->Form->input('fecha_nacimiento.month',array( 'type' => 'hidden' ));
				echo $this->Form->input('fecha_nacimiento.year',array( 'type' => 'hidden' ));
				echo $this->Form->input('typodocument_id',array( 'type' => 'hidden'));
				echo $this->Form->input('nro_documento',array( 'type' => 'hidden'));
				echo $this->Form->input('gruposanguineo_id',array( 'type' => 'hidden'));
				echo $this->Form->input('email', array('type' => 'hidden'));
				echo $this->Form->input('telefono',array( 'type' => 'hidden'));
				echo $this->Form->input('financiador',array( 'type' => 'hidden'));
				echo $this->Form->input('stateperson_id',array( 'type' => 'hidden'));
			echo $this->Form->end(__('Cargar un Nuevo Paciente', true));
		}
?>
</div>